﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Search.aspx.cs" Inherits="Help" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script src="scripts/Movies.js" type="text/javascript"></script>
    <asp:TextBox ID="txt_search" runat="server"></asp:TextBox>
    <asp:DropDownList ID="ddl_category" runat="server" 
        DataSourceID="SqlDataSource1" DataTextField="Name" DataValueField="Name">
    </asp:DropDownList>
     <asp:Button ID="btn_search" runat="server" Text="Search using dropdown list" 
        onclick="btn_search_Click" />
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString %>" 
        SelectCommand="SELECT Name, CategoryID FROM Category"></asp:SqlDataSource>

    <asp:GridView ID="GridView1" runat="server">
        <Columns>
            <asp:HyperLinkField DataNavigateUrlFields="MovieID" 
                DataNavigateUrlFormatString="~/Movie.aspx?MovieID={0}" DataTextField="Title" />
        </Columns>
    
    </asp:GridView>

    <asp:TextBox ID="txt_search_single" runat="server"></asp:TextBox>
    <asp:Button ID="btn_search_single" runat="server" 
        Text="Search using single field" onclick="btn_search_single_Click" />

    <asp:GridView ID="GridView2" runat="server">
        <Columns>
            <asp:HyperLinkField DataNavigateUrlFields="MovieID" 
                DataNavigateUrlFormatString="~/Movie.aspx?MovieID={0}" DataTextField="Title" />
        </Columns>
    </asp:GridView>

    <asp:DropDownList ID="ddl_Director" runat="server" 
        DataSourceID="SqlDataSource2" DataTextField="Director" 
        DataValueField="Director"  >
    </asp:DropDownList>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString %>" 
        SelectCommand="SELECT DISTINCT [Director] FROM [Movie]"></asp:SqlDataSource>
    <asp:Button ID="btn_GoTo" runat="server" Text="Go To" 
        onclick="btn_GoTo_Click" />
    <asp:GridView ID="GridView3" runat="server">
        <Columns>
            <asp:HyperLinkField DataNavigateUrlFields="MovieID" 
                DataNavigateUrlFormatString="~/Movie.aspx?MovieID={0}" DataTextField="Title" />
        </Columns>
    </asp:GridView>

</asp:Content>

